# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=help2man
pkgver=1.47.3
pkgrel=1
pkgdesc="Conversion tool to create man files"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/help2man/"
license=('GPL')
groups=('base-devel')
depends=('perl-Locale-Gettext' 'libintl')
install=help2man.install
source=(http://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
        1.40.4-cygwin-nls.patch)
sha256sums=('c232af6475ef65bee02770862a362f4c4c2e6c9967d39e987eb94cadcfc13856'
            'SKIP'
            '6cf5541d6233b6c0ce0248ecb6376682646ee56f795b19906f0acc63d83de482')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p2 -i ${srcdir}/1.40.4-cygwin-nls.patch
  autoreconf -ivf
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure \
      --build=${CHOST} \
      --prefix=/usr \
      --mandir=/usr/share/man \
      --infodir=/usr/share/info \
      --libdir=/usr/lib

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
